/**
 * Copyright (C), 2015-2021, XXX有限公司
 * FileName: MyOrderSearchActivity
 * Author: Gxjkz
 * Date: 2021/7/27 13:32
 * Description: 订单搜索
 * History:
 * <author> <time> <version> <desc>
 * 作者姓名 修改时间 版本号 描述
 */
package com.niuxiaofa.newlaw.Activity;

import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.library.AutoFlowLayout;
import com.example.library.FlowAdapter;
import com.niuxiaofa.newlaw.Base.BaseActivity;
import com.niuxiaofa.newlaw.R;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

/**
 * @ClassName: MyOrderSearchActivity
 * @Description: 订单搜索
 * @Author: Gxjkz
 * @Date: 2021/7/27 13:32
 */
public class MyOrderSearchActivity extends BaseActivity {

    ArrayList<String> list;

    @BindView(R.id.flowLayout)
    AutoFlowLayout flowLayout;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_myorder_search;
    }


    @Override
    protected void initData() {
        list = new ArrayList<String>();
        list.add("12233");
        list.add("1123");
        list.add("12ewqewqewqewqeqeweqew3");
        list.add("1223");
        list.add("12323");
        list.add("123333"); list.add("123212313");


        addData(list);

    }

    private void addData( ArrayList<String> list) {
        //流式布局适配器
        flowLayout.setAdapter(new FlowAdapter(list) {
            @Override
            public View getView(int i) {
                //引入视图
                View inflate = LayoutInflater.from(getActivity()).inflate(R.layout.item_textview, null, false);
                //获取视图控件
                TextView auto_tv = inflate.findViewById(R.id.auto_tv);
                //修改值
                auto_tv.setText(list.get(i));
                //清空当前集合

                //返回视图
                return inflate;
            }
        });
    }


}